package com.dylon.system.domain;

import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

@Data
public class SysMenu extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private Long    menuId;
    private String  menuName;  //'名称',
    private Long    parentId;  //'父节点',
    private Integer orderNum;  //'显示顺序',
    private String  url;   //'请求地址',
    private String  menuType;  //'菜单类型，M目录，C菜单，F按钮',
    private String  visible;   //'状态，0显示，1隐藏',
    private String  perms;  //'权限标识',
    private String  icon;   //'菜单图标',

    private String  parentName; //父节点名称

    private List<SysMenu> children = new ArrayList<SysMenu>();

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("menuId", getMenuId())
                .append("menuName", getMenuName())
                .append("parentId", getParentId())
                .append("orderNum", getOrderNum())
                .append("url", getUrl())
                .append("menuType", getMenuType())
                .append("visible", getVisible())
                .append("perms", getPerms())
                .append("icon", getIcon())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
